import csv
import os

from remain_b2 import read_file_to_list

'''
在第二批中删除第一批数据
'''
# CSV文件路径和目录路径
directory_path = 'E:/data/palm_vein/SCUT-PV-V2/b2'  # 替换为你要检查的目录路径

filename = 'b1.txt'
file_lst = read_file_to_list(filename)

# 遍历目录并删除同名文件
for filename in file_lst:
    file_path = os.path.join(directory_path, filename)
    if os.path.exists(file_path):
        os.remove(file_path)
        print(f"Deleted {file_path}")
    else:
        print(f"{file_path} does not exist")